<?
class SlidesController extends BaseController{
    public function __construct($id = null){
        parent::__construct();
    }
    
    public function GetHomeSlide() {
        $db_query = new db_query('SELECT sli_id,sli_title,sli_link,sli_type,sli_picture,sli_active,sli_position
                                  FROM slides
                                  WHERE 1 AND sli_active = 1 AND sli_type = "home"
                                  ORDER BY sli_position
                                  LIMIT 12');
        $list_slide = array();
        while($row = mysql_fetch_assoc($db_query->result)) {
            $slide = array();
            $slide['title'] = $row['sli_title'];
            $slide['link'] = $row['sli_link'];
            $slide['picture'] = PATH_PICTURE_SLIDE.$row['sli_picture'];
            $list_slide[] = $slide;
        }unset($db_query);
        
        $html = SlidesLayout::home_slide(array('slide'=>$list_slide));
        return $html;
        
    }
    
}
?>